<template>
	<div>
		<h4 style="text-align: justify;">我的课程表</h4>
		<hr style="width: 100%;">
		<div>
			<table style="width: 95%;" border="1" cellspacing="0">
				<tbody>
					<tr>
						<th>教师编号</th>
						<th>教师名称</th>
						<th>班级编号</th>
						<th>班级名称</th>
						<th>课程编号</th>
						<th>课程名称</th>
					</tr>
					<tr v-for="c in data.mycourses">
						<td>{{c.user.uid}}</td>
						<td>{{c.user.uname}}</td>
						<td>{{c.clz.clzno}}</td>
						<td>{{c.clz.clzname}}</td>
						<td>{{c.course.cno}}</td>
						<td>{{c.course.cname}}</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
</template>

<script setup>
	import { onMounted, reactive, ref } from "vue"
	import { $get } from "@/ajax";

	const data = reactive({
		mycourses:[]
	})
	
	onMounted(()=>{
		$get("/api/fore/stu/findMyCourse")
		.then((resp) => {
			data.mycourses = resp.data.data
		})
	})

</script>

<style>
</style>